package com.atguigu.gmall.feign.search;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.search.Goods;
import com.atguigu.gmall.search.vo.SearchParamVo;
import com.atguigu.gmall.search.vo.SearchRespVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Description
 * @Return
 * @Author https://weiranyi.github.io
 * @Date Created in 2022-12-12 15:18
 **/
@RequestMapping("api/inner/rpc/search")
@FeignClient("service-search")
public interface SearchFeignCilent {
    @PostMapping("/up/goods")
    Result upGoodsToES(@RequestBody Goods goods);

    @PostMapping("down/goods/{skuId}")
    Result downGoodsToES(@PathVariable("skuId") Long skuId);

    @PostMapping("/searchGoods")
    Result<SearchRespVo> search(@RequestBody SearchParamVo searchParamVo);

    @PostMapping("/hotScore/{skuId}/{score}")
    Result autoIncrementHotScore(@PathVariable("skuId")Long skuId,@PathVariable("score")Long score);
}
